home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 4.1 KB | 143 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWPrmise.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWPRMISE_H
- #define FWPRMISE_H
-
- #ifndef FWPRTDEF_H
- #include "FWPrtDef.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWRUNTYP_H
- #include "FWRunTyp.h"
- #endif
-
- #ifndef FWPRIDEB_H
- #include "FWPriDeb.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef FWODTYPS_H
- #include "FWODTyps.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class ODStorageUnitView;
- class ODStorageUnit;
-
- class FW_CFrame;
- class FW_CPart;
- class FW_CSelection;
- class FW_CCloneInfo;
- class FW_CLinkSource;
- class FW_CDataInterchange;
-
- //========================================================================================
- // class FW_CPromise
- //========================================================================================
-
- class FW_CPromise
- {
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- FW_CPromise(Environment*ev,
- FW_EStorageKinds storageKind,
- FW_CCloneInfo* cloneInfo);
- FW_CPromise(Environment*ev,
- FW_CLinkSource* linkSource,
- FW_CCloneInfo* cloneInfo);
- virtual ~FW_CPromise();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- virtual void Promise(Environment *ev,
- ODStorageUnit* storageUnit,
- ODPropertyName propertyName,
- ODValueType valueType);
-
- virtual void FulfillPromise(Environment *ev,
- ODStorageUnitView *promiseSUView,
- ODPropertyName propertyName,
- ODValueType valueType,
- FW_CCloneInfo* cloneInfo) = 0;
-
- FW_CFrame* GetScopeFrame(Environment *ev) const;
-
- FW_EStorageKinds GetStorageKind(Environment *ev) const;
-
- ODUpdateID GetUpdateID(Environment *ev) const;
-
- ODPropertyName GetPropertyName(Environment *ev) const;
- ODValueType GetValueType(Environment *ev) const;
-
- //----------------------------------------------------------------------------------------
- // Internal only
- //
- public:
- long PrivHandleFulfillPromise(Environment *ev,
- ODStorageUnitView *promiseSUView);
- FW_CLinkSource* PrivGetLinkSource(Environment *ev) const;
-
- //----------------------------------------------------------------------------------------
- // Data members
- //
- private:
- FW_CFrame* fScopeFrame;
- FW_EStorageKinds fStorageKind;
- ODUpdateID fUpdateID; // for clipboard promise
- FW_CLinkSource* fLinkSource; // for link promise
- FW_Boolean fPromised;
- FW_CDataInterchange* fDataInterchange;
- long fPromiseCount;
- };
-
- //----------------------------------------------------------------------------------------
- // FW_CPromise::GetUpdateID
- //----------------------------------------------------------------------------------------
- inline ODUpdateID FW_CPromise::GetUpdateID(Environment*) const
- {
- return fUpdateID;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPromise::GetScopeFrame
- //----------------------------------------------------------------------------------------
- inline FW_CFrame* FW_CPromise::GetScopeFrame(Environment*) const
- {
- return fScopeFrame;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPromise::GetStorageKind
- //----------------------------------------------------------------------------------------
- inline FW_EStorageKinds FW_CPromise::GetStorageKind(Environment*) const
- {
- return fStorageKind;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPromise::PrivGetLinkSource
- //----------------------------------------------------------------------------------------
- inline FW_CLinkSource* FW_CPromise::PrivGetLinkSource(Environment*) const
- {
- FW_ASSERT(fStorageKind == FW_kLinkStorage);
- return fLinkSource;
- }
-
- #endif